#!/bin/sh
#
# Startup script for cups as standalone server
#

# Make sure the device has a /dev entry
# Make device if not present (not devfs)
if ( [ ! -c /dev/lp0 ] ) then
  # Make /dev/net directory if needed
  mknod /dev/lp0 c 180 0
fi

# Make sure the printer driver is running
if ( !(lsmod | grep "^printer" -q) ); then
        insmod %OPTWARE_TARGET_PREFIX%/lib/modules/printer.o
fi

if [ -n "`%OPTWARE_TARGET_PREFIX%/bin/pidof cupsd`" ]; then
    %OPTWARE_TARGET_PREFIX%/bin/killall cupsd 2>/dev/null
fi

%OPTWARE_TARGET_PREFIX%/sbin/cupsd


